package cn.magic.controller;

import cn.magic.ajax.AjaxResult;
import cn.magic.domain.Product;
import cn.magic.feignclient.StoreFeignClient;
import cn.magic.service.impl.IProdectServiceimpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class productController {

    @Autowired
    private IProdectServiceimpl prodectServiceimpl;

    @PostMapping("/product/save")
    public AjaxResult save (@RequestBody Product product){
        try {
            prodectServiceimpl.save(product);
            return AjaxResult.me();
        } catch (Exception e){
            e.printStackTrace();
            return AjaxResult.me().setSuccess(false).setMessage("系统繁忙");
        }
    }



}
